<script setup lang="ts">
import { inject, computed } from "vue";
import type {
  FormDesignerComponents,
  FormItemPerm
} from "../FormComponentMixin";
const props = defineProps({
  type: {
    type: String,
    default: ""
  },
  mode: {
    type: String,
    default: "normal" //组件模式，free设计模式，normal 编辑模式, read 阅读模式，disable 禁用模式
  }
});

const config = defineModel<FormDesignerComponents>("config");
const perm = inject<Array<FormItemPerm>>("perm") as FormItemPerm[];

const disabled = computed(() => {
  if (props.mode === "disable") {
    return true;
  }
  return false;
});

const readonly = computed(() => {
  if (props.mode === "read") {
    return true;
  }
  return false;
});
</script>

<template>
  <div style="margin-left: 5px; min-width: 70px">
    <el-tooltip
      effect="dark"
      :content="config.props.placeholder"
      :placement="config.props.placement"
    >
      <el-icon size="20"><QuestionFilled /></el-icon>
    </el-tooltip>
  </div>
</template>

<style lang="scss" scoped></style>
